<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <title>学生模块</title>
    <!-- Bootstrap core CSS -->
    <link href="../static/asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.js"></script>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="../static/asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:replace="sidbar::#topbar"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="sidbar::#sbar"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <div class="chartjs-size-monitor"
                 style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;">
                <div class="chartjs-size-monitor-expand"
                     style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                    <div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div>
                </div>
                <div class="chartjs-size-monitor-shrink"
                     style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                    <div style="position:absolute;width:200%;height:200%;left:0; top:0"></div>
                </div>
            </div>


            <br/>
            <br/>
            <div class="container-fluid" style="border:gray solid 1px ">
                <div class="row">
                    <div class="col-md-2 col-md-offset-5"><a class="btn btn-primary"
                            th:href="@{/selStu(id=${session.teaAll.getId()})}" >我的学生信息</a></div>
                </div>
                <div class="row">
                    <div class="col-md-2">
                        <a th:href="@{/toAdd(id=${session.teaAll.getId()})}" class="btn btn-warning">添加学生</a>
                    </div>
                    <div class="col-md-2 col-md-offset-1">
                        <a th:href="@{/allStu(id=0)}" class="btn btn-info">查看全部学生</a>
                    </div>


                    <div class="col-md-6 col-md-offset-1">
                        <form th:action="@{/selStuByName}" method="post">
                            名字：<input type="text" name="name">
                            <input type="submit" value="查询" class="btn btn-success">
                        </form>
                    </div>

                </div>
                <div th:if="${bj!=1&&bj!=2&&bj!=3&&bj!=4}" style="font-size: large;text-align: center;border: 1px gray solid;background: #d2ffa9">
                    [[${iud}]]成功！学生信息： <br>
                    学生编号:[[${student1.getId()}]]  <br>
                    学生名字:[[${student1.getName()}]] <br>
                    年龄：[[${student1.getAge()}]] &nbsp;&nbsp;

                    <div th:text="${student1.getSex()==1?'性别：男':'性别：女'}"></div> <br>
                    <div th:each="cn:${cname}" th:if="${cn.getId()==student1.getClassId()}">
                       班级：  [[${cn.getName()}]]
                    </div>
                </div>
                <div id="bodyy" th:if="${bj==1||bj==2||bj==3||bj==4}">
                    <a th:href="@{/all/1}" hidden>aa</a>
                    <!--                    <button id="btn" th:onclick="stu(1)">bb</button>-->
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>学生编号</th>
                            <th>学生名字</th>
                            <th>年龄</th>
                            <th>性别</th>
                            <th>班级</th>
                            <th>个人信息</th>
                            <th>操作（只能操作自己学生的信息）</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="its,a:${pageInfoL.list}">

                            <td th:text="${its.getId()}">学生id</td>
                            <td class="primary"><a class="btn btn-outline-primary" th:href="@{/stuMe(id=${its.getId()})}">[[${its.getName()}]]</a></td>
                            <td th:text="${its.getAge()}">年龄</td>
                            <td th:text="${its.getSex()==1?'男':'女'}">性别</td>

                            <td class="border-info" th:each="cn:${cname}" th:if="${cn.getId()==its.getClassId()}">
                                <a class="btn btn-outline-info" th:href="@{/selStuByCid(id=${its.getClassId()})}" th:text="${cn.getName()}"></a>
                            </td>
                            <td class="success"><a class="btn btn-outline-success" th:href="@{/stuMe(id=${its.getId()})}">详情</a></td>
                            <!--										<td>${items.favourite}</td>-->
                            <td class="warning" th:each="cid:${session.cids}" th:if="${cid==its.getClassId()}"  shiro:lacksPermission="root" > <a class="btn btn-outline-warning" th:href="@{/toUpd(id=${its.getId()})}">修改</a>
                                &nbsp; |&nbsp;<a  class="btn btn-outline-danger" th:href="@{/delStu(id=${its.getId()})}">删除</a></td>
                            <td class="warning" shiro:hasPermission="root"  >
                                <a class="btn btn-outline-warning" th:href="@{/toUpd(id=${its.getId()})}">修改</a>
                                &nbsp; |&nbsp;<a  class="btn btn-outline-danger" th:href="@{/delStu(id=${its.getId()})}">删除</a></td>
                            <td  shiro:lacksPermission="root"> </td>
                        </tr>
                        </tbody>
                    </table>

                    <div class="col-md-2">
                        当前[[${pageInfoL.pageNum}]]页,总共[[${pageInfoL.pages}]]页,总[[${pageInfoL.total}]]条记录
                    </div>

                    <!--                    查询所有学生-->

                    <nav th:if="${bj==2}" aria-label="Page navigation" style="text-align: center">
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/allStu(id=0,pageNum=1)}">
                                    <span aria-hidden="true">首页</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/allStu(id=0,pageNum=${pageInfoL.pageNum -1})}" aria-label="Next">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>

                        </ul>
                        <ul class="pagination pagination-lg" th:each="na:${pageInfoL.navigatepageNums}">
                            <li><a th:href="@{/allStu(id=0,pageNum=${na})}" th:if="${pageInfoL.pageNum!=na}"
                                   th:text="${na}" ></a></li>
                            <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfoL.pageNum==na}"
                                                     th:text="${na}"></a></li>
                        </ul>
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/allStu(id=0,pageNum=${pageInfoL.pageNum +1})}" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/allStu(id=0,pageNum=${pageInfoL.pages})}" aria-label="Next">
                                    <span aria-hidden="true">末页</span>
                                </a>
                            </li>
                        </ul>
                    </nav>

                    <!--                    查询我的学生-->
                    <nav th:if="${bj==1}" aria-label="Page navigation" style="text-align: center">
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/selStu(id=${session.teaAll.getId()},pageNum=1)}">
                                    <span aria-hidden="true">首页</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/selStu(id=${session.teaAll.getId()},pageNum=${pageInfoL.pageNum -1})}"
                                   aria-label="Next">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                        </ul>
                        <ul class="pagination pagination-lg" th:each="na:${pageInfoL.navigatepageNums}">
                            <li><a th:href="@{/selStu(id=${session.teaAll.getId()},pageNum=${na})}"
                                   th:if="${pageInfoL.pageNum!=na}" th:text="${na}"></a></li>
                            <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfoL.pageNum==na}"
                                                     th:text="${na}"></a></li>
                        </ul>
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/selStu(id=${session.teaAll.getId()},pageNum=${pageInfoL.pageNum +1})}"
                                   aria-label="Next">

                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{selStu(id=${session.teaAll.getId()},pageNum=${pageInfoL.pages})}" aria-label="Next">
                                    <span aria-hidden="true">末页</span>
                                </a>
                            </li>
                        </ul>
                    </nav>


                    <!--                    根据老师id查询学生-->
                    <nav th:if="${bj==4}" aria-label="Page navigation" style="text-align: center">
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/selOStu(id=${session.tid},pageNum=1)}">
                                    <span aria-hidden="true">首页</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/selOStu(id=${session.tid},pageNum=${pageInfoL.pageNum -1})}"
                                   aria-label="Next">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>

                        </ul>
                        <ul class="pagination pagination-lg" th:each="na:${pageInfoL.navigatepageNums}">
                            <li><a th:href="@{/selOStu(id=${session.tid},pageNum=${na})}"
                                   th:if="${pageInfoL.pageNum!=na}" th:text="${na}"></a></li>
                            <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfoL.pageNum==na}"
                                                     th:text="${na}"></a></li>
                        </ul>
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/selOStu(id=${session.tid},pageNum=${pageInfoL.pageNum +1})}"
                                   aria-label="Next">

                                    <span aria-hidden="true">&raquo;</span>
                                </a>

                            </li>
                            <li>
                                <a th:href="@{/selOStu(id=${session.tid},pageNum=${pageInfoL.pages})}" aria-label="Next">
                                    <span aria-hidden="true">末页</span>
                                </a>
                            </li>
                        </ul>
                    </nav>

                    <!--                    根据名字查询学生-->
                    <nav th:if="${bj==3}" aria-label="Page navigation" style="text-align: center">
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/selStuByName(name=${name1},pageNum=1)}">
                                    <span aria-hidden="true">首页</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/selStuByName(name=${name1},pageNum=${pageInfoL.pageNum -1})}"
                                   aria-label="Next">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>

                        </ul>
                        <ul class="pagination pagination-lg" th:each="na:${pageInfoL.navigatepageNums}">
                            <li><a th:href="@{/selStuByName(name=${name1},pageNum=${na})}"
                                   th:if="${pageInfoL.pageNum!=na}" th:text="${na}"></a></li>
                            <li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfoL.pageNum==na}"
                                                     th:text="${na}"></a></li>
                        </ul>
                        <ul class="pagination pagination-lg">
                            <li>
                                <a th:href="@{/selStuByName(name=${name1},pageNum=${pageInfoL.pageNum +1})}"
                                   aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/selStuByName(name=${name1},pageNum=${pageInfoL.pages})}" aria-label="Next">
                                    <span aria-hidden="true">末页</span>
                                </a>
                            </li>
                        </ul>
                    </nav>

                </div>
            </div>

        </main>
    </div>
</div>

<script>


</script>
</body>

</html>